function TableParcels(container, item, options) {
  this._container = container;
  this._item = item;
  this._options = options;
  this._updated = (options && options.updated) ? options.updated : null;
  this._noExist = (options && options.noExist) ? options.noExist : false;
  this._isSupervise = (options && options.s) ? options.s : 0;
  
  this._createElements();
};

TableParcels.prototype._createElements = function() {
  var gui, table, _self = this, unique = MiscUtils.unique();
  
  DOMUtils.removeChildElements(this._container);
  DOMUtils.removeChildElements(this._updated);
  
    table1 = document.createElement('table');

    tr = table1.insertRow(-1);
    tr.style.backgroundColor = '#fff';
   
    td = tr.insertCell(-1);
    td.style.height = '12px';
    
        a = document.createElement('img');
        a.src = 'images/buttons/tosend.png';
        a.onmouseover = function(){this.src = 'images/buttons/tosend_h.png';};
        a.onmouseout = function(){this.src = 'images/buttons/tosend.png';};
        a.style.border = 0;
        a.style.align ='right';
        a.href = '#';
        
        //a.onclick = "location.href='?p=pagefactory&t=pageb4miscparcels&m={%22a%22:1,%22b%22:5,%22c%22:5}'";
        a.onclick = function() { location.href = '?p=pagefactory&t=pageb4miscparcels&m=' + _self._options.menu};
        
        td.appendChild(a); 
  this._container.appendChild(table1);
  
  
  table = document.createElement('table');
  table.style.width = '740px';
  table.style.height = '24px';
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.borderTop = 'solid 1px #694247';
  table.style.borderLeft = 'solid 1px #694247';
  table.id = unique + '_produce_table';
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  tr.style.backgroundColor = '#7a5052';
  
  td = tr.insertCell(-1);
  td.style.width = '108px';
  td.style.height = '24px';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';
  td.style.padding = '0 0 0 10px';
  td.style.textAlign = 'left';
  td.style.fontFamily = 'Arial';
  td.style.verticalAlign = 'middle';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('C/Date'));
  
  td = tr.insertCell(-1);
  td.style.width = '124px';
  td.style.height = '24px';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';
  td.style.padding = '0 0 0 10px';  
  td.style.textAlign = 'left';
  td.style.verticalAlign = 'middle';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('Name'));
  
  td = tr.insertCell(-1);
  td.style.width = '62px';
  td.style.height = '24px';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';  
  td.style.padding = '0 0 0 10px';
  td.style.textAlign = 'left';
  td.style.verticalAlign = 'middle';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('Num'));
  
  td = tr.insertCell(-1);
  td.style.width = '190px';
  td.style.height = '24px';
  td.style.textAlign = 'left';
  td.style.verticalAlign = 'middle';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';
  td.style.padding = '0 0 0 10px';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('Destination'));
  
  td = tr.insertCell(-1);
  td.style.height = '24px';
  td.style.width = '45px';
  td.style.textAlign = 'left';
  td.style.verticalAlign =  'middle';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';
  td.style.padding = '0 0 0 10px';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('Courier'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.verticalAlign =  'middle';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '100%';
  td.style.color = 'white';
  td.style.padding = '0 0 0 10px';
  td.style.borderRight = 'solid 1px #ffffff';
  td.appendChild(document.createTextNode('Status'));  
  
  gui = GuiTableParcels.instance(unique);
  new HandleTableParcels(gui, this._item, this._options);
};